package p1;

public class Iterative {

	public static int addn(int n){
		int result=0;
		for (int i=1; i<=n; i++)
			result = result + i;
		return result;
	}
	public static void main( String[] a ){
		final int N = 10;
		int result = addn( N );
		System.out.println( "Sum from 1 to " + N + " is " + result);
	}
}
